I'm very much new to Doors DXL scripting. |
Re: DXL script to search for a specific string in table object
A doors "table" has a single invisible "table" object and one or more subordinate invisible "row" objects. The "cell" objects which you can see are subordinate to the row objects.
These two perms get the corresponding "table" or "row", if any, for an object:
string IsTrue(bool in_bool)
{ if (in_bool) //
then return("true")
else return("")
}
void Info(Object obj)
{ print identifier(obj) "\t"IsTrue(table(obj)) "\t" IsTrue(row(obj)) "\t" IsTrue(cell(obj)) "\t"
print (number(obj)) "\t\t[" obj."Object Text" "]\n"
}
Object oRow, oCell
print "ID\tTable\tRow\tCell\tPara\t\t[Text]\n"
for obj in entire (current Module) do
{ if (!table(obj)) continue
Info(obj)
for oRow in obj do
{ Info(oRow)
for oCell in oRow do
{ Info(oCell)
}
}
}
Skip skpTablesDone = create()
for obj in mod do
{ if obj has my string
{ oTable = getTable(obj)
if (null oTable) then export obj
elseif(put(skpTablesDone, oTable, oTable)) then export entire oTable
else ignore obj // already exported this object's table
}
}
|
Re: DXL script to search for a specific string in table object llandale - Mon Mar 26 09:47:59 EDT 2012
A doors "table" has a single invisible "table" object and one or more subordinate invisible "row" objects. The "cell" objects which you can see are subordinate to the row objects.
These two perms get the corresponding "table" or "row", if any, for an object:
string IsTrue(bool in_bool)
{ if (in_bool) //
then return("true")
else return("")
}
void Info(Object obj)
{ print identifier(obj) "\t"IsTrue(table(obj)) "\t" IsTrue(row(obj)) "\t" IsTrue(cell(obj)) "\t"
print (number(obj)) "\t\t[" obj."Object Text" "]\n"
}
Object oRow, oCell
print "ID\tTable\tRow\tCell\tPara\t\t[Text]\n"
for obj in entire (current Module) do
{ if (!table(obj)) continue
Info(obj)
for oRow in obj do
{ Info(oRow)
for oCell in oRow do
{ Info(oCell)
}
}
}
Skip skpTablesDone = create()
for obj in mod do
{ if obj has my string
{ oTable = getTable(obj)
if (null oTable) then export obj
elseif(put(skpTablesDone, oTable, oTable)) then export entire oTable
else ignore obj // already exported this object's table
}
}
I'll work on your inputs. |